using System;
using UnityEngine;

[Serializable]
public class CameraBehaviour
{
	public enum CameraPosition
	{
		DartFollowCamera = 0,
		ObserveDartboardCamera = 1,
		DartHitCamera = 2,
		CloseLookAim = 3,
		CloseLookAim1 = 4,
		CloseLookAim2 = 5,
		CloseLookDart = 6,
		ShowScore = 7,
		ShowWin = 8,
		ShowIntro = 9
	}

	public CameraPosition position;

	public float moveSpeed;

	public float rotSpeed;

	protected Camera camera;

	protected float time;

	public virtual void Start(Camera cam, bool instant)
	{
		camera = cam;
		time = 0f;
		if (instant)
		{
			Transform transform = camera.transform;
			transform.position = DesiredPosition();
			transform.rotation = DesiredRotation();
		}
	}

	public virtual void Update()
	{
		time += Time.deltaTime;
		Transform transform = camera.transform;
		transform.position = Vector3.Lerp(transform.position, DesiredPosition(), Time.deltaTime * moveSpeed);
		transform.rotation = Quaternion.Lerp(transform.rotation, DesiredRotation(), Time.deltaTime * rotSpeed);
	}

	protected virtual Quaternion DesiredRotation()
	{
		return Quaternion.identity;
	}

	protected virtual Vector3 DesiredPosition()
	{
		return Vector3.zero;
	}
}
